package com.chuan.controller;

import com.chuan.entity.User;
import com.chuan.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 用户(User)表控制层
 *
 * @author 张川
 * @since 2019-10-15 10:52:12
 */
@RestController
public class UserController {
    /**
     * 服务对象
     */
    @Resource
    private UserService userService;


    @ResponseBody
    @GetMapping("selectOne/{id}")
    public User selectOne(@PathVariable("id")Integer id) {
        return this.userService.queryById(id);
    }

    @ResponseBody
    @GetMapping("/Hello")
    public String hello(){
        return "Hello Jenkins8";
    }

    @GetMapping("/1")
    public String test1(){
        return "1";
    }

}
